#coding=utf-8
from concurrent.futures import ThreadPoolExecutor


class DbExecutor(object):
    _instance = None
    # 单例模式不考虑线程锁，总是从主线程调用

    def __init__(self):
        self._thread_pool = ThreadPoolExecutor(10)

    @staticmethod
    def instance():
        if DbExecutor._instance is None:
            DbExecutor._instance = DbExecutor()
        return DbExecutor._instance